﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="POption.aspx.cs" MasterPageFile="~/Admin/Admin.Master"Inherits="TimKen.Web.Admin.PAttribute.Option" %>

<asp:Content ContentPlaceHolderID="ContentTitle" runat="server" ID="Content2">产品属性</asp:Content>
<asp:Content ContentPlaceHolderID="ContentMain" runat="server" ID="Content1">
 <script  type="text/javascript">
     function checkForm() {
         if (document.getElementById("<%=this.txtAttrNameCN.ClientID%>").value == "" || document.getElementById("<%=this.txtAttrNameEN.ClientID%>").value  == "") {
             alert(x_OptionNameNotAllowBlank);
             return false;
         }

         if (document.getElementById("<%=rblFieldType.ClientID%>").value == "") {
             alert(x_FieldTypeNotAllowBlank);
             return false
         }
         return true;
     }

     /**
     * 点击类型按钮时切换选项的禁用状态
     */
     function radioClicked() {
         n = document.getElementById("<%=rblFieldType.ClientID%>").value;
         document.forms[0].elements["<%=txtFieldMetaDataCN.ClientID%>"].disabled = n > 0 ? false : true;
         document.forms[0].elements["<%=txtFieldMetaDataEN.ClientID%>"].disabled = n > 0 ? false : true;
     }
 </script>"



<table width="100%" id="general-table">
      <tr>
        <td class="label">属性名称：</td>
        <td>
        <img src="/images/chinese.gif" border="0" alt="Chinese" title=" Chinese"><asp:TextBox runat="server" ID="txtAttrNameCN"></asp:TextBox>
        <img src="/images/english.gif" border="0" alt="English" title=" Chinese"><asp:TextBox runat="server" ID="txtAttrNameEN"></asp:TextBox>
          <span class="require-field">*</span>
        </td>
      </tr>
      <tr>
        <td class="label">该属性值的录入方式：</td>
        <td>
         
            <asp:RadioButtonList ID="rblFieldType" runat="server"     onclick="radioClicked()"
                RepeatDirection="Horizontal">
                <asp:ListItem Value="0">单行文本</asp:ListItem>
                <asp:ListItem Value="1">多行文本</asp:ListItem>
                <asp:ListItem Value="2">下拉选择(数据格式Value:Text.可选值之间逗号隔开)</asp:ListItem>
            </asp:RadioButtonList>
        </td>
      </tr>
        <tr>
          <td class="label">可选值列表：</td>
          <td>
<table width="100%" id="general-table0">
      <tr>
        <td>
        <img src="/images/chinese.gif" border="0" alt="Chinese" title=" Chinese"><asp:TextBox 
                runat="server" ID="txtFieldMetaDataCN" Height="75px" TextMode="MultiLine" 
                Width="175px"></asp:TextBox>
        <img src="/images/english.gif" border="0" alt="English" title=" Chinese"><asp:TextBox 
                runat="server" ID="txtFieldMetaDataEN" Height="75px" TextMode="MultiLine" 
                Width="175px"></asp:TextBox>
          <span class="require-field">*</span>
        </td>
      </tr>
      </table>

            </td>
        </tr>
      <tr>
        <td colspan="2">
        <div class="button-div">
            <asp:Button ID="btnOK" runat="server" CssClass="button" onclick="ok_Click"  OnClientClick="return checkForm();"
                Text="确定" />
            &nbsp;&nbsp;
            <asp:Button ID="btnCancel" runat="server" CssClass="button" Text="取消" />
            &nbsp;
        </div>
        </td>
      </tr>
 </table>


    <div class="list-div">
 <asp:GridView  ID="gridPoption" runat="server"   CssClass="grid" AutoGenerateColumns="False"
            DataKeyNames="OptionID" OnRowCommand="grdPType_RowCommand" HorizontalAlign="Left"
            GridLines="Horizontal" 
             >
       <Columns>
                 <asp:TemplateField>
                    <HeaderStyle HorizontalAlign="Center"   Width="150" />
                    <HeaderTemplate>
                        <%=GetLangString("OptionName")%>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <%#Eval("OptionName")%>
                    </ItemTemplate>
                </asp:TemplateField>
                
            
                  <asp:TemplateField>
                    <HeaderStyle HorizontalAlign="Center"   Width="150" />
                    <HeaderTemplate>
                        <%=GetLangString("FieldType")%>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <%#Eval("FieldType")%>
                    </ItemTemplate>
                </asp:TemplateField>
                
                
                  <asp:TemplateField>
                    <HeaderStyle HorizontalAlign="Center" />
                    <ItemStyle Width="80" HorizontalAlign="Center" />
                    <HeaderTemplate>
                        <%=GetLangString("Operation")%>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <asp:ImageButton ID="btnEdit" runat="server" ToolTip='<%#GetLangString("Edit")%>'
                            CommandName="EditEvent" CommandArgument='<%#Eval("OptionID")%>' ImageUrl="~/Admin/images/icon_edit.gif" />
                        <asp:ImageButton ID="btnDelete" runat="server" ToolTip='<%#GetLangString("Delete")%>'
                            CommandName="DeleteEvent" CommandArgument='<%#Eval("OptionID")%>' ImageUrl="~/Admin/images/icon_drop.gif"
                            OnClientClick="return deleteConfirm()" />
                    
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
 </asp:GridView>
 
    <div style="clear: left">
            <ux:AspNetPager ID="AspNetPager1" runat="server" Width="100%" ShowPageIndexBox="Always"
                HorizontalAlign="right" EnableTheming="true" AlwaysShow="true" PageIndexBoxType="DropDownList"
                OnPageChanged="AspNetPager1_PageChanged">
            </ux:AspNetPager>
        </div>
    </div>
 
</asp:Content>